package com.da.javatest.leetCode;

import java.util.Arrays;
import java.util.List;

/**
 * @author chenlida
 * @date 2019/1/8 15:02
 * @description
 */
public class Code762 {
    private List<Integer> zs = Arrays.asList(2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47);

    public int countPrimeSetBits(int L, int R) {
        int total = 0;
        for (int i = L; i <= R; i++) {
            if (zs.contains(Integer.toBinaryString(i).replace("0", "").length())) {
                total++;
            }
        }
        return total;
    }
}
